<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./promise.js"></script>
    <script>
        let p = new Promise((resolve, reject) => {
            resolve(2)
            // reject(3);
            // setTimeout(() => {
            //     // resolve(111);
            //     reject('222')
            // }, 1000)
        });

        p.then (value => {
            console.log("onResolved1----" + value);
        }, reason => {
            console.log("onRejected----" + reason);
        })



        // p.then (value => {
        //     console.log("onResolved2----" + value);
        // }, reason => {
        //     console.log("onRejected2----" + reason);
        // })
        console.log(p);
    </script>
</body>
</html>